﻿using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using QldtSdh.DAL.Models.Mapping;

namespace QldtSdh.DAL.Models
{
    public partial class CEMS4UG_DHKHContext : DbContext
    {
        static CEMS4UG_DHKHContext()
        {
            Database.SetInitializer<CEMS4UG_DHKHContext>(null);

        }

        public CEMS4UG_DHKHContext()
            : base("Name=CEMS4UG_DHKHContext")
        {
        }

        public CEMS4UG_DHKHContext(string connectionString)
            : base(connectionString)
        {
            this.Configuration.LazyLoadingEnabled = true;
        }

        public DbSet<AppUser> AppUserDbSet { get; set; }
        public DbSet<AppUser_Function> AppUser_FunctionDbSet { get; set; }
        public DbSet<BaoLuu> BaoLuuDbSet { get; set; }
        public DbSet<ChuongTrinhDaoTao> ChuongTrinhDaoTaoDbSet { get; set; }
        public DbSet<ChuongTrinhDaoTao_HocPhan> ChuongTrinhDaoTao_HocPhanDbSet { get; set; }
        public DbSet<CoSoDaoTao> CoSoDaoTaoDbSet { get; set; }
        public DbSet<DonVi> DonViDbSet { get; set; }
        public DbSet<DotTuyenSinh> DotTuyenSinhDbSet { get; set; }
        public DbSet<GiangVien> GiangVienDbSet { get; set; }
        public DbSet<HocKy> HocKyDbSet { get; set; }
        public DbSet<HocPhan> HocPhanDbSet { get; set; }
        public DbSet<HocVien> HocVienDbSet { get; set; }
        public DbSet<HocVien_KetQuaHocTap> HocVien_KetQuaHocTapDbSet { get; set; }
        public DbSet<KhoaHoc> KhoaHocDbSet { get; set; }
        public DbSet<KhoaHoc_NganhDaoTao> KhoaHoc_NganhDaoTaoDbSet { get; set; }
        public DbSet<LopHocPhan> LopHocPhanDbSet { get; set; }
        public DbSet<LopHocPhan_BangDiem> LopHocPhan_BangDiemDbSet { get; set; }
        public DbSet<LopHocPhan_BangDiemHocVien> LopHocPhan_BangDiemHocVienDbSet { get; set; }
        public DbSet<LopHocPhan_HocVien> LopHocPhan_HocVienDbSet { get; set; }
        public DbSet<LopHocPhan_PhanCongGiangDay> LopHocPhan_PhanCongGiangDayDbSet { get; set; }
        public DbSet<LopHocPhan_ThoiKhoaBieu> LopHocPhan_ThoiKhoaBieuDbSet { get; set; }
        public DbSet<LopKhoaNganh> LopKhoaNganhDbSet { get; set; }
        public DbSet<NganhDaoTao> NganhDaoTaoDbSet { get; set; }
        public DbSet<PhongHoc> PhongHocDbSet { get; set; }
        public DbSet<NhatKyHoatDong> NhatKyHoatDongDbSet { get; set; }
        public DbSet<DotThi> DotThiDbSet { get; set; }
        public DbSet<DotThi_LopHocPhan> DotThi_LopHocPhanDbSet { get; set; }
        public DbSet<KeHoachDaoTao> KeHoachDaoTaoDbSet { get; set; }
        public DbSet<DeTai> DeTaiDbSet { get; set; }
        public DbSet<LoaiDeTai> LoaiDeTaiDbSet { get; set; }
        public DbSet<CongViecBanGiangVien> CongViecBanGiangVienDbSet { get; set; }

        public DbSet<NghienCuuSinh> NghienCuuSinhDbSet { get; set; }
        public DbSet<NganhDaoTaoNCS> NganhDaoTaoNCSDbSet { get; set; }
        public DbSet<KhoaHocNCS> KhoaHocNCSDbSet { get; set; }
        public DbSet<ThongBaoNCS> ThongBaoNCSDbSet { get; set; }

        public DbSet<KeyValueConfig> KeyValueDbSet { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            System.Diagnostics.Debug.WriteLine("Bắt đầu tạo Model");
            modelBuilder.Configurations.Add(new AppUserMap());
            modelBuilder.Configurations.Add(new AppUser_FunctionMap());
            modelBuilder.Configurations.Add(new BaoLuuMap());
            modelBuilder.Configurations.Add(new ChuongTrinhDaoTaoMap());
            modelBuilder.Configurations.Add(new ChuongTrinhDaoTao_HocPhanMap());
            modelBuilder.Configurations.Add(new CoSoDaoTaoMap());
            modelBuilder.Configurations.Add(new DonViMap());
            modelBuilder.Configurations.Add(new DotTuyenSinhMap());
            modelBuilder.Configurations.Add(new GiangVienMap());
            modelBuilder.Configurations.Add(new HocKyMap());
            modelBuilder.Configurations.Add(new HocPhanMap());
            modelBuilder.Configurations.Add(new HocVienMap());
            modelBuilder.Configurations.Add(new HocVien_KetQuaHocTapMap());
            modelBuilder.Configurations.Add(new KhoaHocMap());
            modelBuilder.Configurations.Add(new KhoaHoc_NganhDaoTaoMap());
            modelBuilder.Configurations.Add(new LopHocPhanMap());
            modelBuilder.Configurations.Add(new LopHocPhan_BangDiemMap());
            modelBuilder.Configurations.Add(new LopHocPhan_BangDiemHocVienMap());
            modelBuilder.Configurations.Add(new LopHocPhan_HocVienMap());
            modelBuilder.Configurations.Add(new LopHocPhan_PhanCongGiangDayMap());
            modelBuilder.Configurations.Add(new LopHocPhan_ThoiKhoaBieuMap());
            modelBuilder.Configurations.Add(new LopKhoaNganhMap());
            modelBuilder.Configurations.Add(new NganhDaoTaoMap());
            modelBuilder.Configurations.Add(new PhongHocMap());
            modelBuilder.Configurations.Add(new NhatKyHoatDongMap());
            modelBuilder.Configurations.Add(new DotThiMap());
            modelBuilder.Configurations.Add(new DotThi_LopHocPhanMap());
            modelBuilder.Configurations.Add(new KeHoachDaoTaoMap());
            modelBuilder.Configurations.Add(new DeTaiMap());
            modelBuilder.Configurations.Add(new LoaiDeTaiMap());
            modelBuilder.Configurations.Add(new CongViecBanGiangVienMap());

            modelBuilder.Configurations.Add(new NghienCuuSinhMap());
            modelBuilder.Configurations.Add(new KhoaHocNCSMap());
            modelBuilder.Configurations.Add(new NganhDaoTaoNCSMap());
            modelBuilder.Configurations.Add(new ThongBaoNCSMap());

            modelBuilder.Configurations.Add(new KeyValueConfigMap());

            System.Diagnostics.Debug.WriteLine("Kết thúc tạo Model");
        }
    }
}
